package com.tomhu.test;

// List<String[]>lists和List<String>list的误区

import java.util.ArrayList;
import java.util.List;

public class Arrays {
	
	public static void main(String[] args) {
		String[] name = {"tom", "hu"};
		
		System.out.println(name.hashCode());
		
		String value = "chenliu";
		System.out.println(value.hashCode());
		
		List<String[]> list = new ArrayList<String[]>();
		List<String> lists = new ArrayList<String>();
		list.add(name);
		lists.add(value);
		name[0] = "chen";
		name[1] = "hui";
		list.add(name);
		System.out.println(value.hashCode());
		value = "huhong";
		
		lists.add(value);
		System.out.println(name.hashCode());
		for(int i = 0; i < list.size(); i++) {
			for(int j = 0; j < list.get(i).length; j++) {
				System.out.println(list.get(i)[j]);
			}
		}
		for(int i = 0; i < lists.size(); i++) {
			System.out.println(lists.get(i));
		}
	}
}
/*367252042
742642698
742642698
367252042
chen
hui
chen
hui
chenliu
huhong
 */
